package com.smartcruise.start.flashActivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.WindowManager;

import com.smartcruise.R;
import com.smartcruise.base.BaseActivity;
import com.smartcruise.main.MainActivity;
import com.smartcruise.start.loginActivity.LoginActivity;

/**
 * Created by FengChaoQun
 * on 2018/1/18 0018
 * 闪屏页面
 */

public class FlashActivity extends BaseActivity implements FlashContract.View {

    private FlashContract.Presenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_flash);
        setEnableRightSlide(false);
        //启动页全屏展示
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        presenter = new FlashPresenterImp(this);
        presenter.start();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.destroy();
    }

    /**
     * description:前往登录界面
     */

    @Override
    public void gotoLoginActivity() {
        startActivity(new Intent(getActivity(), LoginActivity.class));
        finish();
    }

    /**
     * description:前往主界面
     */

    @Override
    public void gotoMainActivity() {
        MainActivity.start(getActivity());
        finish();
    }
}
